package com.yksj.healthtalk.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class LoginUtil {
	/**
	* @Title: isEmail 
	* @Description: 验证邮箱号码
	* @param @param email
	* @param @return    
	* @return boolean    
	* @throws
	 */
	public static boolean isEmail(String email) {
		String strPattern = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
		Pattern p = Pattern.compile(strPattern);
		Matcher m = p.matcher(email);
		if (m.matches()) {
			return true;
		} else {
			return false;
		}
	}
	
	/**
	* @Title: isMobileNumber 
	* @Description: 验证手机号码
	* @param @param value
	* @param @return    
	* @return boolean    
	* @throws
	 */
	public static boolean isMobileNumber(String value) {
	        if (value.length() >= 11) {
	            value = value.substring(value.length() - 11);
	            String regExp = "^((13[0-9])|(13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$";
	            Pattern p = Pattern.compile(regExp);
	            Matcher m = p.matcher(value);
	            return m.find();
	        }
	        return false;
	    }
	
}